<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>宽带故障与账号问题反映</title>
    <link rel="stylesheet" href="__PUBLIC__/home/css/weui.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/home/css/example.css"/>
    <!--<link rel="stylesheet" href="__PUBLIC__/home/css/reset.css"/>-->
    <style>
        .fg .red{
            color: red;
        }
    </style>
</head>
<body>
<div class="hd">
    <h1 class="page_title">宽带故障报修</h1>
    <p class="page_desc">广西水利电力职业技术学院</p>
    <div class="weui_btn_area">
        <a  id="btn1" class="weui_btn weui_btn_plain_primary forgot" id="huan" href="{:U('Home/Index/chax')}">查询报修情况 →</a>
        <!--<a  id="btn2" class="weui_btn weui_btn_plain_primary forgot" style="display: none">← 报修宽带</a>-->
    </div>
</div>
<!--<div class="weui_cells_title">绑定教务系统帐号</div>-->




<form action="__URL__/addTable" method="post" id="dengji" onsubmit="return subcheck();">
<div id="bx_reg active">
    <div class="weui_cells weui_cells_form">
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" name="name" type="text" placeholder="请输入姓名" required/>
            </div>
        </div>
    </div>
    <div class="weui_cells weui_cells_form">
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">学号</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" name="stuid" type="text" placeholder="请输入学号" required/>
            </div>
        </div>
    </div>
    <div class="weui_cells weui_cells_form">
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">手机</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" name="phone" type="text" placeholder="请输入手机" required/>
            </div>
        </div>
    </div>
    <div class="weui_cells weui_cell weui_cell_select weui_select_after">
        <div class="weui_cell_hd">
            <label class="weui_label">宿舍楼：</label>
        </div>
        <div class="weui_cell_bd weui_cell_primary">
            <select class="weui_select" name="dorid" required>
            <option value="">请选择宿舍楼</option>
               <volist name="ret1" id="vo1">
            <option value="{$vo1.dorid}">{$vo1.dorname}</option>
            </volist>
            </select>
        </div>
    </div>
    <div class="weui_cells weui_cells_form">
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">宿舍号</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" name="dornum" type="text" placeholder="请输入宿舍号" required/>
            </div>
        </div>
    </div>
    <div class="weui_cells weui_cell weui_cell_select weui_select_after">
        <div class="weui_cell_hd">
            <label class="weui_label">故障类型：</label>
        </div>
        <div class="weui_cell_bd weui_cell_primary">
            <select class="weui_select" name="typeid" required>
                <option value="">请选择故障类型</option>
                <volist name="ret2" id="vo2">
                <option value="{$vo2.typeid}">{$vo2.maltype}</option>
            </volist>
            </select>
        </div>
    </div>
    <div class="weui_cells weui_media_box weui_media_text">
        <div class="fg">
                <h5 class="red weui_media_desc">账号问题反映：</h5>
                <p class="red weui_media_desc">1.说明如错误代码</p>
                <p class="red weui_media_desc">2.忘记密码/改密码的需要持本人证件(学生证或身份证)至一下地点修改</p>
                <p class="red weui_media_desc">&nbsp;&nbsp;教学楼缴费处、公寓楼6栋201、202、203、206</p>
                <h5 class="red weui_media_desc">网络故障报修：</h5>
                <p class="red weui_media_desc">说明如拨号后出现的错误代码、本地连接断开、受限制、网口/模块损坏、经常掉线等</p>
        </div>    
    </div>
   <div class="weui_cells weui_cells_form">
        <div class="weui_cell">
            <div class="weui_cell_bd weui_cell_primary">
                <textarea class="weui_textarea" name="matdes" placeholder="请输入问题描述" rows="3" required></textarea>
            </div>
        </div>
    </div>
    <div class="weui_cells weui_cells_form" id="vk">
        <div class="weui_cell weui_vcode" id="verify">
            <div class="weui_cell_hd"><label class="weui_label">验证码</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" id="ver" name="verify" type="text" placeholder="请输入验证码" required/>
            </div>
            <div class="weui_cell_ft" id="img">
                <img src="{:U('verify')}" onclick="this.src=this.src"/>
            </div>
        </div>
    </div>
    <div class="weui_btn_area">
        <input class="weui_btn weui_btn_primary" id="sub" type="submit" value="确定">
    </div>
</div>
</form>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
    function check() {
        var ret;
        var verify = $("#ver").val();
        var url = "{:U('Home/Index/check_verify')}";
        $.post(url, {verify: verify}, function (data) {
            if (data) {
                $("#verify").removeClass("weui_cell_warn");
                $("#img_warn").remove();
                $("#errmsg").remove();
                $("#sub").removeClass("weui_btn_disabled").addClass("weui_btn_primary");
                return ret = true;
            } else {
                $("#verify").removeClass("weui_cell_warn").addClass("weui_cell_warn");
                $("#img_warn").remove();
                $("#errmsg").remove();
                $("#sub").removeClass("weui_btn_primary").addClass("weui_btn_disabled");

                $("#img").prepend('<i id="img_warn" class="weui_icon_warn"></i>');
                $("#vk").after('<div class="weui_cells_tips" id="errmsg" style="color: red">如果看不清，可以点击图片更换</div>');
                return ret = false;
            }
        });
        return ret;
    }

    function subcheck() {
        $.ajaxSetup({
            async: false
        });
        if (check()) {
            $("#loadingToast").show();
            return true;
        } else {
            return false;
        }
    }
    $(function () {
        $("#ver").focusout(function () {
            check();
        });
    });


</script>
</body>
</html>